#!/usr/bin/env python
# coding=utf-8
# __author__ = 'Yunchao Ling'

data = set()

infile1 = open("oa_file_list.txt", "r")
infile1.readline()
for line in infile1:
    line = line.rstrip("\n")
    splitline = line.split("\t")
    filepath = splitline[0][11:]
    data.add(filepath)
infile1.close()

infile2 = open("oa_comm_use_file_list.txt", "r")
outfile = open("file_list.txt.duplication", "w")
infile2.readline()
for line in infile2:
    line = line.rstrip("\n")
    splitline = line.split("\t")
    filepath = splitline[0][11:]
    if filepath in data:
        outfile.write(line + "\n")
        outfile.flush()
outfile.close()
infile2.close()
